<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue-2.4.0.js"></script>
    <script src="lib/vue-resource-1.3.4.js"></script>
</head>
<body>
    <div id="app">
        <input @click="getInfo" type="button" value="get请求">
        <input @click="postInfo" type="button" value="post请求">
        <input @click="jsonpInfo" type="button" value="jsonp请求">
    </div>
    <script>
        var vm=new Vue({
            el:'#app',
            data:{

            },
            methods:{
                getInfo(){
                    this.$http.get('http://www.liulongbin.top:3005/api/getnewslist')
                    .then(function (result) {
                        console.log(result)
                        console.log(result.data)
                        console.log(result.body)
                    })
                },
                postInfo(){
                    this.$http.post('http://www.liulongbin.top:3005/api/post',{},{emulateJSON:true})
                    .then(result=>{
                        console.log(result)
                    })
                },
                jsonpInfo(){
                    this.$http.jsonp('http://www.liulongbin.top:3005/api/jsonp')
                        .then(result=>{
                            console.log(result)
                        })
                }
            }
        })
    </script>
</body>
</html>